export {};

function createNumberArray(length: number, value: number):Array<number> {
    const arr = Array<number>(length).fill(value);
    return arr;
}

function createStringArray(length: number, value: string):Array<string> {
    const arr = Array<string>(length).fill(value);
    return arr;
}


function createArray<M>(length: number, value: M):Array<M> {
    return Array<M>(length).fill(value); 
}


const res = createNumberArray(3, 100);
const res1 = createStringArray(3, '1');

const res2 = createArray(3, '111');
const res3 = createArray(3, 421);
console.log(res, res1, res2, res3);